﻿/**
* Title:"项目";
*
* Description:
*        功能：
*
* Author:Tongwel
*
* Date:2018.6
*
* Modify:
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace DemoSpace
{
    //一个command只能执行一个功能
    public class Render2ViewCommand :ICommand
    {
        PackProxy packProxy = PackProxy.Instance;
        GoodProxy goodProxy = GoodProxy.Instance;

        PackView view;

        public void Excute(INotifier notifier)
        {
            //获取 背包集合
            List<PackModel> modelList = packProxy.GetModelList();
            for (int i = 0; i < modelList.Count; i++)
            {
                if (modelList[i].GoodID!=0)
                {
                    PackModel packModel = modelList[i];
                    //根据物品id获取物品，给packModel中的goodsModel赋值
                    modelList[i].goodModel = goodProxy.GetModelByID(packModel.GoodID);
                }
            }
            //将数据传递个packView
            view.ShowPack(modelList);
        }
    }
}